package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* ClassName: UserShopController
* Description:
* @Author HTAO
* @Create 2023/11/3 15:21
 *
 *
*/

@RestController
@RequestMapping("/user/shop")
@Api(tags = "店铺相关接口")
@Slf4j
public class UserShopController {

    @Autowired
    RedisTemplate redisTemplate;
    public static final String key = "SHOP_STATUS";

    @PutMapping("/status")
    @ApiOperation("营业状态获取")
    public Result<Integer> setStatus(){
        log.info("店铺状态获取");
        Integer status = (Integer) redisTemplate.opsForValue().get(key);
        return Result.success(status);
    }

}
